package week0503;

import java.util.Scanner;

class ArrayUtils {
	static class PairResult {
		public PairResult(double min, double max) {
			this.min = min;
			this.max = max;
		}
		public PairResult() {
			this.min = 0.0;
			this.max = 0.0;
		}
		private double min;
		private double max;
		public String toString () {
			return "PairResult [min="+min+", "+"max="+max+"]";
		}
	}
	static PairResult findMinMax(double[] values) {
		double min = values[0];
		double max = values[0];
		for (int i = 1;i<values.length;i++) {
			if(values[i]<min) {
				min = values[i];
			}
			if(values[i]>max) {
				max = values[i];
			}
		}
		return new PairResult(min,max);
	}
	
}
public class week0503 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		double[] v = new double[n];
		for(int i=0;i<n;i++) {
			v[i] = in.nextDouble();
		}
		System.out.println(ArrayUtils.findMinMax(v));
		System.out.println(ArrayUtils.PairResult.class);
	}

}